{include file='public/head'}
<style>
    .layui-form-label{
        width: 100px;
    }
    .layui-input-block{
        margin-left: 130px;
    }
</style>
<body>
<div class="x-body">
    <form class="layui-form" id='mainForm' method="post" action="info.html">

        <input type="hidden" name="id" value="{$data.id}">

        <div class="layui-form-item">
            <label class="layui-form-label"><span style="color: red">*</span>用户名</label>
            <div class="layui-input-block">
                <input type="text" value="{$data.username}" class="layui-input" disabled>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><span style="color: red">*</span>姓名</label>
            <div class="layui-input-block">
                <input type="text" id="truename" value="{$data.truename}" name="truename" lay-verify="required" autocomplete="off"
                       placeholder="请输入姓名" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><span style="color: red">*</span>手机</label>
            <div class="layui-input-block">
                <input type="text" id="mobile" value="{$data.mobile}" name="mobile" lay-verify="required"
                       placeholder="请输入手机号码" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><span style="color: red">*</span>邮箱</label>
            <div class="layui-input-block">
                <input type="text" id="email" value="{$data.email}" name="email" autocomplete="off" lay-verify="required"
                       placeholder="请输入邮箱" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">密&nbsp;&nbsp;&nbsp;码</label>
            <div class="layui-input-block">
                <input type="text" id="password" name="password" lay-verify="pass" placeholder="留空为不修改"
                       autocomplete="off" class="layui-input" autocomplete="off">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">确&nbsp;&nbsp;&nbsp;认</label>
            <div class="layui-input-block">
                <input type="text" id="check_password" name="check_password" placeholder="确认密码" autocomplete="off"
                       class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><span style="color: red">*</span>智赢Token</label>
            <div class="layui-input-block">
                <input type="text" id="token" name="token" placeholder="智赢Token" autocomplete="off" lay-verify="required"
                       class="layui-input" value="{$data.token}">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">已用容量</label>
            <div class="layui-input-block">
                <input type="text" value="{$info.use_capacity|default='不限'}" class="layui-input" disabled>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">允许上传容量</label>
            <div class="layui-input-block">
                <input type="text" value="{$info.upload_capacity|default='不限'}" class="layui-input" disabled>
                <span style="position:absolute;top:10px;right:20px;">GB</span>
            </div>
        </div>

        <div class="layui-form-item">
            <div>
                <button style="width: 100%" class="layui-btn" lay-submit="" lay-filter="toSubmit">提交保存</button>
            </div>
        </div>

    </form>
</div>
</body>
{include file='public/foot'}
<script type="text/javascript">
    $(document).ready(function () {
        var form = layui.form;
        var layer = layui.layer;
        var options = {
            type: 'post',           //post提交
            // url:'http://ask.tongzhuo100.com/server/****.php?='+Math.random(),   //url
            dataType: "json",        //json格式
            data: {},    //如果需要提交附加参数，视情况添加
            clearForm: false,        //成功提交后，清除所有表单元素的值
            resetForm: false,        //成功提交后，重置所有表单元素的值
            cache: false,
            async: false,          //同步返回
            success: function (data) {
                console.log(data);
                if (data.code == 0) {
                    layer.msg(data.msg);
                } else {
                    layer.msg(data.msg, {icon: 1, time: 500}, function () {
                        location.reload();
                    });
                }
                //服务器端返回处理逻辑
            },
            error: function (XmlHttpRequest, textStatus, errorThrown) {
                layer.msg('操作失败:服务器处理失败');
            }
        };

        // bind form using 'ajaxForm'
        $('#mainForm').ajaxForm(options).submit(function (data) {
        });
    });
</script>
</html>
